#include "minimap.h"

MiniMap::MiniMap(QPixmap map, QGraphicsScene *scene, QGraphicsView * view)
    : QGraphicsPixmapItem(map)
{
    if ((200.0/pixmap().width()) < (130.0/pixmap().height()))
        setScale(200.0/pixmap().width());    // This has to be 200.0 or it will do integer division and will resuly in a 1 or 0
    else
        setScale(130.0/pixmap().height());

    scene->addItem(this);

    parentView = view;

    screenRect = new ScreenRectItem(this,scene);

    screenRect->setRect(0,0,parentView->width()-2,parentView->height()-152);
}
